package com.hi3v.auth.monitor.db;

import com.hi3v.auth.monitor.core.Person;
import org.jdbi.v3.sqlobject.config.RegisterBeanMapper;
import org.jdbi.v3.sqlobject.customizer.Bind;
import org.jdbi.v3.sqlobject.statement.SqlQuery;
import org.jdbi.v3.sqlobject.statement.SqlUpdate;



public interface PersonDAO  {
    @SqlUpdate("create table something (id int primary key, name varchar(100))")
    void createSomethingTable();

    @SqlUpdate("insert into something (id, name) values (:id, :name)")
    void insert(@Bind("id") int id, @Bind("name") String name);

    @SqlQuery("select id,name fullName from something where id = :id")
    @RegisterBeanMapper(Person.class)
    Person findNameById(@Bind("id") int id);
}
